import 'dart:convert';

ClassDto classDtoFromJson(String str) => ClassDto.fromJson(json.decode(str));

String classDtoToJson(ClassDto data) => json.encode(data.toJson());

class ClassDto {
  ClassDto({
    this.className,
    this.level,
    this.settings,
    this.teacherUserNames,
  });

  String? className;
  String? level;
  Settings? settings;
  List<String>? teacherUserNames;

  factory ClassDto.fromJson(Map<String, dynamic> json) => ClassDto(
        className: json["className"],
        level: json["level"],
        settings: Settings.fromJson(json["settings"]),
        teacherUserNames: json["teacherUserNames"] != null
            ? List<String>.from(json["teacherUserNames"].map((x) => x))
            : null,
      );

  Map<String, dynamic> toJson() => {
        "className": className,
        "level": level,
        "settings": settings?.toJson(),
        "teacherUserNames": teacherUserNames != null
            ? List<dynamic>.from(teacherUserNames!.map((x) => x))
            : null,
      };
}

class Settings {
  Settings({
    this.audio,
    this.lang,
    this.language,
    this.pinyin,
  });

  bool? audio;
  String? lang;
  String? language;
  bool? pinyin;

  factory Settings.fromJson(Map<String, dynamic> json) => Settings(
        audio: json["audio"],
        lang: json["lang"],
        language: json["language"],
        pinyin: json["pinyin"],
      );

  Map<String, dynamic> toJson() => {
        "audio": audio,
        "lang": lang,
        "language": language,
        "pinyin": pinyin,
      };
}
